import request from './index'


//首页发现
export const gethomepage = () => request.get('/homepage/block/page')

//获取音乐url
export const getsong = (id, level) => request.get(`/song/url/v1?id=${id}&level=${level}`)

//获取专辑内容
export const getalbumlist = id => request.get(`/album/detail/dynamic?id=${id}`)

//获取登录二维码key
export const getqrkey = () => request.get('/login/qr/key')

//获取登录二维码
export const createqr = key => request.get(`/login/qr/create?key=${key}&qrimg=true`)

//获取验证码
export const getcaptcha = phone => request.get(`/captcha/sent?phone=${phone}`)

//检测验证码
export const checkqr = key => request.get(`/login/qr/check?key=${key}`)

//用户登录
export const login = (...data) => {
    if (data[0] == "password") {
        return request.post(`/login/cellphone?phone=${data[1]}&password=${data[2]}`)
    } else {
        return request.post(`/login/cellphone?phone=${data[1]}&captcha=${data[3]}`)
    }
}

//轮播图
export const getbanner = () => request.get(`/banner?type=0`)